#ifndef __WIIMOTE_H__
#define __WIIMOTE_H__

#include "wiiuse/wiiuse.h"

namespace MediaCenter
{
    class Wiimote
    {
    public:
        Wiimote(wiimote* wiimote);
        ~Wiimote();

        void SetRumble(int rumbleValue);
        void SetLEDs(int ledCodes);

        bool ButtonDown(int buttonCode);
        bool ButtonUp(int buttonCode);
        bool ButtonPress(int buttonCode);
        bool ButtonRelease(int buttonCode);

		wiimote* GetWiiusePtr() { return wm; }

		WIIUSE_EVENT_TYPE GetEvent() { return wm->event; }
		WCONST int GetID() { return wm->unid; }

		bool AccelerationEnabled() { return WIIUSE_USING_ACC(wm); }
		vec3b_t GetAcceleration() { return wm->accel; }

		void EnableMotion() { wiiuse_motion_sensing(wm, 1); }

		bool Connected;

    private:
        wiimote* wm;
    };
}
#endif
